#ifndef TEXTEDIT_H
#define TEXTEDIT_H
#include <QTextEdit>

class TextEdit : public QTextEdit
{
    Q_OBJECT
public:
    explicit TextEdit(QWidget* parent = nullptr) : QTextEdit { parent } { }
    explicit TextEdit(const QString& text, QWidget* parent = nullptr) : QTextEdit { text, parent }
    {
    }

Q_SIGNALS:
    void editFinished();

protected:
    void focusOutEvent(QFocusEvent* e) override
    {
        QTextEdit::focusOutEvent(e);
        Q_EMIT editFinished();
    }
};

#endif // TEXTEDIT_H
